package com.crm.jdy.service.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.jdy.common.dto.ReturnPlanInfoDto;
import com.crm.jdy.common.mapper.PeoductInfoMapper;
import com.crm.jdy.common.pojo.ClientChargeInfo;
import com.crm.jdy.common.pojo.ReturnPlanInfo;
import com.crm.jdy.common.mapper.ReturnPlanInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**   
 * @Description:(回款计划表服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class ReturnPlanInfoServiceImpl  extends ServiceImpl<ReturnPlanInfoMapper,ReturnPlanInfo> implements ReturnPlanInfoService  {

    @Autowired
    ReturnPlanInfoMapper returnPlanInfoMapper;

    @Override
    public PageInfo<ReturnPlanInfo> seleteReturnPlanInfo(ReturnPlanInfoDto callAplanInfoDto) {
           PageHelper.startPage( callAplanInfoDto.getCurrentPage(),callAplanInfoDto.getPageSize());
           List<ReturnPlanInfo> bookList = returnPlanInfoMapper.seleteReturnPlanInfo(callAplanInfoDto);
           PageInfo<ReturnPlanInfo> pageInfo = new PageInfo<ReturnPlanInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateReturnPlanInfo(ReturnPlanInfo returnPlanInfo) {
        return returnPlanInfoMapper.updateById(returnPlanInfo) > 0;
    }

    @Override
    public boolean addReturnPlanInfo(ReturnPlanInfo returnPlanInfo) {
        return returnPlanInfoMapper.insert(returnPlanInfo) > 0;
    }

    @Override
    public boolean removeReturnPlanInfo(String iplanId) {
        return returnPlanInfoMapper.deleteById(iplanId) > 0;
    }
}